<template>
  <my-ref
      url="/system/sso-config/list"
      v-model="table"
      @loaded="procData"
      :multi="$props.multi"
      :page-size="10"
      ref="list"
      name="sso应用配置"
      :store="true"
      v-bind="$attrs"
      @change="v=>$emit('change',v)"
      :readOnly="$props.readOnly"
  >


    <el-table-column label="应用名称" align="center">
      <template v-slot="scope">
        <div class="link">{{ scope.row.name }}</div>
      </template>
    </el-table-column>
    <el-table-column align="center" label="应用秘钥" prop="secrect"></el-table-column>
    <el-table-column align="center" label="应用主页" prop="homepageUrl"></el-table-column>
    <el-table-column align="center" label="应用Host" prop="host"></el-table-column>
    <el-table-column align="center" label="描述" prop="remark"></el-table-column>
    <el-table-column align="center" label="所属企业" prop="corp.name"></el-table-column>
    <el-table-column align="center" label="创建时间" prop="createAt"></el-table-column>
    <el-table-column align="center" label="更新时间" prop="updateAt"></el-table-column>
    <template #query="scope">
      <kv label="名称">
        <el-input v-model="scope.query.name"></el-input>
      </kv>
    </template>
    <template #button>
      <el-button>选择sso应用配置</el-button>
    </template>
  </my-ref>
</template>
<script setup>
/**
 * Created by CodeGenerator at 2021-04-06 16:42:07
 */



defineOptions({
    name: "sso-config-ref",
    inheritAttrs: true,
});

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({});


const $props = defineProps({
    readOnly : { type: Boolean },
    multi : { type: Boolean }
});


const $model = defineModel({ type: [Object,Array] });



const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);

const table = $computed({ get() {
        return $model;
    },set(v){
        var v = Object.assign(v.getJsType() == "array" ? [] : {}, v);
        $emit("update:modelValue", v);
    } });

const procData = function(res, op) {
    var json = res.data.data;
    json.forEach(it => {
//如果是组合实体，设置 it.id=...
    });
};





</script>